﻿<UserControl x:Class="Passwords.Views.AboutView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:models="clr-namespace:Passwords.Models"
             xmlns:controls="clr-namespace:Passwords.Controls"
             xmlns:vm="clr-namespace:Passwords.ViewModels"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             mc:Ignorable="d" 
             d:DesignHeight="431" d:DesignWidth="724">
    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="14"/>
        </Style>
        <ControlTemplate TargetType="UserControl" x:Key="template">
            <Grid Margin="0,5,10,0"  >
                <Grid.DataContext>
                    <vm:AboutViewModel/>
                </Grid.DataContext>
                <Grid.InputBindings>
                    <KeyBinding Key="Enter" Command="{x:Static vm:Commands.LoginCommand}" CommandParameter="{Binding ElementName= passwordBox}"/>
                </Grid.InputBindings>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal" Margin="10,5,10,20">
                    <Image Source="/Passwords;component/Images/Passwords.png" />
                    <TextBlock Text="Passwords" FontSize="48" FontWeight="Light" VerticalAlignment="Bottom"  Margin="10,0,0,-10" />
                </StackPanel>

                <Grid Grid.Row="1" x:Name="stack2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-44,0,0">

                </Grid>
                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="12,0,0,0">
                    <TextBlock Margin="0"  Text="Version " VerticalAlignment="Center" FontWeight="Bold" />
                    <TextBlock Margin="0"  Text="{Binding Version, FallbackValue=0.0.1}" VerticalAlignment="Center" FontWeight="Bold" />
                </StackPanel>
                <TextBlock Grid.Row="2"   Margin="12,0,0,0" Text="Copyrights (c) 2011 Thomas Gerber"  />
                <TextBlock Grid.Row="3"   Margin="12,20,0,5" TextWrapping="Wrap">
                    <Label Content="{Binding rs.AboutGetPhoneApp, Source={StaticResource locale}}" Margin="-5,0,0,0"/>
                    <LineBreak/>
                    <Hyperlink  NavigateUri="http://tgapps.wordpress.com/Passwords"  >http://tgapps.wordpress.com/Passwords
			        <i:Interaction.Triggers>
				        <i:EventTrigger EventName="RequestNavigate">
					        <ei:LaunchUriOrFileAction Path="http://tgapps.wordpress.com/Passwords"/>
				        </i:EventTrigger>
			        </i:Interaction.Triggers>
                        </Hyperlink>
                </TextBlock>

                <TextBlock Grid.Row="4"   Margin="12,0,0,0">

                </TextBlock>
                <!--<TextBlock Margin="12,0" Grid.Row="5"  Text="{Binding Location, FallbackValue=location}" VerticalAlignment="Center" TextWrapping="Wrap" />-->
                <!--<Button Grid.Row="5" Width="100" Content="OK" HorizontalAlignment="Left" Margin="12,40,4,4"/>-->

                <!-- Footer:  -->
                <Border BorderThickness="0,0,0,0" Grid.Row="9"  BorderBrush="{DynamicResource TransparentChromeBrush}">
                    <StackPanel x:Name="appPanel" HorizontalAlignment="Center" Margin="10,8,10,0"
                    Orientation="Horizontal">
                        <StackPanel.Resources>
                            <Style TargetType="Button" BasedOn="{StaticResource textButtonStyle}">
                                <Setter Property="FontSize" Value="14" />
                            </Style>
                        </StackPanel.Resources>
                        <Button Content="{Binding rs.Ok, Source={StaticResource locale}}" Command="{x:Static vm:Commands.BackCommand}" />
                        <StackPanel.RenderTransform>
                            <TranslateTransform x:Name="footerTransform"/>
                        </StackPanel.RenderTransform>
                    </StackPanel>
                </Border>
            </Grid>
        </ControlTemplate>
    </UserControl.Resources>
    <UserControl.Style>
        <Style TargetType="UserControl">
            <!--<Setter Property="Template" Value="{StaticResource template}"/>-->
            <Style.Triggers>
                <DataTrigger Binding="{Binding AppDisplayMode}" Value="{x:Static models:AppDisplayMode.About}" >
                    <Setter Property="Template" Value="{StaticResource template}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>

</UserControl>
